import { exchanger as http, application as applicationHttp } from '@zh/common-utils/http'

export { http }

/**
 * 查询列表-输出管理
 * @param {Object} params
 */
export function pageOutModel (params) {
  return http.post('/exchanger/ExchangeAppOutModel/page', params)
}

/**
 * 删除-输出管理
 * @param {String} id
 */
export function delOutModel (id) {
  return http.get('/exchanger/ExchangeAppOutModel/del/' + id)
}

/**
 * 根据id返回信息-输出管理
 * @param {String} id
 */
export function getByIdOutModel (id) {
  return http.get('/exchanger/ExchangeAppOutModel/out/' + id)
}

/**
 * 修改、保存-输出管理
 * @param {Object} params
 */
export function saveOrUpdateOutModel (data) {
  const url = '/exchanger/ExchangeAppOutModel/save'
  return http.post(url, data)
}

/**
 * 根据id修改状态-输出管理
 * @param {Object} params
 */
export function updateStatusOutModel (id) {
  return http.get('/exchanger/ExchangeAppOutModel/status/' + id)
}

/**
 * 查询列表-输入管理
 * @param {Object} params
 */
export function pageInModel (params) {
  return http.post('/exchanger/ExchangeAppInModel/page', params)
}

/**
 * 删除-输入管理
 * @param {String} id
 */
export function delInModel (id) {
  return http.get('/exchanger/ExchangeAppInModel/delete/' + id)
}

/**
 * 根据id返回信息-输入管理
 * @param {String} id
 */
export function getByIdInModel (id) {
  return http.get('/exchanger/ExchangeAppInModel/getInfo/' + id)
}

/**
 * 修改、保存-输入管理
 * @param {Object} params
 */
export function saveOrUpdateInModel (data) {
  const url = data.id
    ? '/exchanger/ExchangeAppInModel/update'
    : '/exchanger/ExchangeAppInModel/save'
  return http.post(url, data)
}

/**
 * 根据id修改状态-输入管理
 * @param {Object} params
 */
export function updateStatusInModel (data) {
  const url = '/exchanger/ExchangeAppInModel/startorstop'
  return http.post(url, data)
}

/**
 * 查询列表-解析器管理
 * @param {Object} params
 */
export function pageTranslation (params) {
  return http.post('/exchanger/ExchangeTranslation/page', params)
}

/**
 * 删除-解析器管理
 * @param {String} id
 */
export function delTranslation (id) {
  return http.get('/exchanger/ExchangeTranslation/delete/' + id)
}

/**
 * 根据id返回信息-解析器管理
 * @param {String} id
 */
export function getByIdTranslation (id) {
  return http.get('/exchanger/ExchangeTranslation/getInfo/' + id)
}

/**
 * 修改、保存-解析器管理
 * @param {Object} params
 */
export function saveOrUpdateTranslation (data) {
  const url = data.id
    ? '/exchanger/ExchangeTranslation/update'
    : '/exchanger/ExchangeTranslation/save'
  return http.post(url, data)
}

/**
 * 根据id修改状态-解析器管理
 * @param {Object} params
 */
export function updateStatusTranslation (data) {
  const url = '/exchanger/ExchangeTranslation/startorstop'
  return http.post(url, data)
}

/**
 * 查询列表-作业管理
 * @param {Object} params
 */
export function pageJob (params) {
  return http.post('/exchanger/ExchangeJob/page', params)
}

/**
 * 删除-作业管理
 * @param {String} id
 */
export function delJob (id) {
  return http.get('/exchanger/ExchangeJob/delete/' + id)
}

/**
 * 根据id返回信息-作业管理
 * @param {String} id
 */
export function getByIdJob (id) {
  return http.get('/exchanger/ExchangeJob/getInfo/' + id)
}

/**
 * 修改、保存-作业管理
 * @param {Object} params
 */
export function saveOrUpdateJob (data) {
  const url = data.id
    ? '/exchanger/ExchangeJob/update'
    : '/exchanger/ExchangeJob/save'
  return http.post(url, data)
}

/**
 * 根据id修改状态-作业管理
 * @param {Object} params
 */
export function updateStatusJob (data) {
  const url = '/exchanger/ExchangeJob/startorstop'
  return http.post(url, data)
}

/**
 * 查询输出列表-作业新增、编辑页面下拉框用
 * @param {Object} params
 */
export function getOutList (params) {
  return http.post('/exchanger/ExchangeAppOutModel/getExchangeAppOutList', params)
}

/**
 * 查询输入列表-作业新增、编辑页面下拉框用
 * @param {Object} params
 */
export function getInList (params) {
  return http.post('/exchanger/ExchangeAppInModel/list', params)
}

/**
 * 查询解析器列表-作业新增、编辑页面下拉框用
 * @param {Object} params
 */
export function getTranslationList (params) {
  return http.post('/exchanger/ExchangeTranslation/list', params)
}

/**
 * 查询应用列表-作业新增、编辑页面下拉框用
 * @param {Object} params
 */
export function getAppList (params) {
  return applicationHttp.post('/app/sysApplication/list', params)
}